package yang.VirtualMachine.chapter9.classStruct;

import java.io.IOException;
import java.io.InputStream;

import yang.VirtualMachine.chapter9.ClassBean;
import yang.VirtualMachine.chapter9.ClassUtil;
import yang.VirtualMachine.chapter9.Processer;

public class ClassVersionProcesser implements Processer {


	@Override
	public void process(InputStream input) throws IOException {
		byte[] dest = new byte[2];
		input.read(dest);
		ClassBean.getInstance().minorVersion = ClassUtil.getNumByBytes(dest);
		System.out.println("minor_version: " + ClassBean.getInstance().minorVersion);

		input.read(dest);
		ClassBean.getInstance().majorVersion = ClassUtil.getNumByBytes(dest);
		System.out.println("major_version: " + ClassBean.getInstance().majorVersion);
	}

}
